<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/19
 * Time: 10:56
 */

namespace app\zucai\home;
use app\index\controller\Home;
use think\Db;

/**
 * Class Play
 * @package app\zucai\home
 * 足彩开奖信息查询
 */

class Play extends Home
{
    //开奖公告接口
    public function index(){
        if($this->request->post()) {  //传值为赛事筛选查询 $title --数组
            $post = $this->request->post();
            $con = Db::name('play_kaijiang')
                ->where('play_id',$post['play_id'])
                ->find();
        }else{
            $con = Db::name('play_kaijiang')
                ->where('opentime','>',date('Y-m-d', strtotime('-7 days')))
                ->order('opentime DESC')
                ->select();
        }
        if($con){
            return returnOk($con);
        }else{
            return returnError('暂无开奖数据！');
        }
    }

    //投注倍数限制接口
    public function max(){
        $con = Db::name('play_rule')
            ->select();
        if($con){
            return returnOk($con);
        }else{
            return returnError('暂无数据！');
        }
    }
}